import { Service } from 'boot/axios'

// 发送短信
export function sendSmsApi <T = any>(data: any) {
  return Service<T>({
    url: 'sms/sendSmsCode',
    method: 'post',
    data
  })
}
// 登陆
export function loginApi <T = any>(data: any, config: {diyError?: boolean} = {}) {
  return Service<T>({
    url: 'member/login',
    method: 'post',
    data,
    ...config
  })
}


export function logoutApi <T = any>() {
  return Service<T>({
    url: 'member/logout',
    method: 'post',
  })
}

export function getInfoApi <T = any>() {
  return Service<T>({
    url: 'channel/baseInfo',
    method: 'post',
  })
}

export function getUserInfoApi <T = any>(data?: any, config: {diyError?: boolean} = {}) {
  return Service<T>({
    url: 'member/getUserInfo',
    method: 'post',
    data,
    ...config
  })
}

export function getAuthInfoApi <T = any>() {
  return Service<T>({
    url: 'member/auth/getAuthUserInfo',
    method: 'post',
  })
}


